package threads;

import java.util.UUID;
import java.util.concurrent.ThreadFactory;

/**
 * Package: threads
 * Description： TODO
 * Author: Forest
 * Date: Created in 2021/4/8 14:09
 * Version: 0.0.1
 * Modified By: duforest
 */
public class HandleThreadFactory implements ThreadFactory {
    @Override
    public Thread newThread(Runnable r) {
        Thread thread = new Thread(r);
        thread.setName("my-"+ UUID.randomUUID());
        thread.setUncaughtExceptionHandler(new MyUncaughtExceptionHandle());
        return thread;
    }
}
